function CoursePlanService() {
    var baseUrl = "/m/courseplan";

    /**
     * 获取全部教学安排记录
     * @param taskId
     * @param callback
     */
    this.getList = function (taskId, callback) {
        var coursePlanList = null;
        $.ajax({
            url: baseUrl + "/list?taskId=" + taskId,
            cache: false,
            success: function (ret) {
                if (ret != "") {
                    coursePlanList = eval(ret);
                }
            },
            complete: function () {
                callback(coursePlanList);
            }
        });
    }


    this.hasCoursePlan = function(taskId, callback){
        var d={};
        d.taskId = taskId;
        $.ajax({
            url: baseUrl + "/has_course_plan",
            data: d,
            success: function (ret) {
                callback(ret);
            }
        });
    }

    // 获取实时课表分数
    this.getPlatformScore = function (taskId, callback) {
        var d={};
        d.taskId = taskId;
        $.ajax({
            url: baseUrl + "/platform_score",
            data: d,
            success: function (ret) {
                callback(ret);
            }
        });
    }

    this.save = function (taskId, data, callback) {
        var ret= 0;
        $.ajax({
            type: "POST",
            url: baseUrl + "/saveAdjust",
            data: {taskId: taskId, coursePlan: data},
            success: function (ret) {
                var data = JSON.parse(ret);
                if (data.code == 1) {
                    ret = 1;
                }
            },
            complete:function () {
                callback(ret);
            }
        });
    }
}